﻿package net.wangit.adm.admin;

import java.util.HashMap;
import java.util.Map;

import net.wangit.adm.role.PrivilegeTreeFactory;
import net.wangit.user.admin.Admin;
import net.wangit.user.admin.AdminFactory;


public class AdminPrivilegeTreeFactory extends PrivilegeTreeFactory {

	public AdminPrivilegeTreeFactory() {
	}

	protected String getDomain() {
		return AdminAuthUI.getAndSetDomain();
	}

	protected Map getPrivileges() throws Exception {
		String aid = AdminAuthUI.getAndSetAdministratorId();
		Admin administrator = AdminFactory.getAdmin(aid);
		return ((Map) (administrator != null ? administrator.getPrivileges()
				: new HashMap()));
	}

	protected boolean isDisabled() {
		return true;
	}
}
